
	<div class="row">
	
	<fieldset>
			<legend>Subjects Set:</legend>
		  <a href="<?php echo site_url('admin/schedule_by_section/'.$schedules->section_id)?>" class="add">Back to View Sections</a><br><br>
		<?if(!empty($schedules)):?>
		<table class="data-table">
			<thead class="tabular-head">
			<tr class="profile_box">
				<th>Subject</th>
				<th>Teacher</th>
				<th>Time</th>
				<th>Day</th>
				<th>Action</th>
			</tr>
			</thead>
			<tbody class="tabular">

				<tr>
					<td><?=$schedules->subj_desc;?></td>
					<td><?=$schedules->teacher;?></td>
					<td><?=$schedules->time_from;?> - <?=$schedules->time_to;?></td>
					<td><?=$schedules->day;?></td>
					<td><a href="<?=site_url('admin/delete_schedule/'.$schedules->schedule_id.'/'.$schedules->section_id);?>" class="del">Delete</a></td>
				</tr>
			</tbody>
		</table>
		<?else:?>
			<div class="notice">No Subject was assigned for this section</div>
		<?endif;?>
	</fieldset>
	
	<?	if(isset($system_message))echo $system_message;
		echo validation_errors() == '' ? NULL : '<div class="error">'.validation_errors().'</div>';
		$subjects_select = array(''=>'Select Subjects...');
		if(!empty($schedules)):
		
			foreach($subjects as $subject)
			{
				$subjects_select[$subject->subj_id] = '['.$subject->subj_code.'] '.$subject->subj_desc ;
			}
			
		$value_t_s = set_value('t_s',$schedules->time_from);
		$value_t_e = set_value('t_e',$schedules->time_to);
		$value_days = set_value('days',$schedules->day);
	?>

		<fieldset>
			<legend>Add New Subject To Schedule</legend>
			<form action="<?=site_url('admin/update_schedule/'.$schedules->schedule_id);?>" method="POST">
				<div class="input-block">
					<label>Select Subject:</label>
					<input type="text" value="<?=$schedules->subj_desc;?>" disabled>
				</div>
				<div class="input-block">
					<label>Time start - Time End</label>
					<input type="text" name="t_s" class="time" style="width:100px;" maxlength="5" value="<?=$value_t_s;?>"> - <input type="text" name="t_e" class="time" style="width:100px;" maxlength="5" value="<?=$value_t_e;?>">
				</div>
				<div class="input-block">
					<label>Days:</label>
					<input type="text" name="days" value="<?=$value_days;?>">
				</div>
				<div class="input-block">
					<label>Teacher In Charge</label>
					<?=form_dropdown('teacher', $teachers,set_value('teacher',$schedules->teacher_id));?>
				</div>
				<div class="input-block" style="clear:both;">
					<input type="hidden" name="schedule_id" value="<?=$schedules->schedule_id;?>">
					<input type="hidden" name="subject_id" value="<?=$schedules->subject_id;?>">
					<?php echo form_submit('update_schedule', 'Update Schedule','class="btn btn-small btn-primary"'); ?>
				</div>
			</form>
		</fieldset>
	<?else:?>
		<div class="notice">
			No subjects Available <a href="<?=site_url('admin/add_subject');?>" class="btn btn-small">Add Subjects</a>
		</div>
	
	<? endif;?>
	

	</div>
